package com.xiaomi.pojo;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Employee implements Serializable {
    private int id;//员工id
    private String name;//员工姓名
    private int age;//员工年龄
    private String phone;//员工电话号
    private String idCard;//员工身份证
    private String address;//员工住址
    private String gender;//员工性别
    private String job;//员工职位
    private double salary;//员工工资
    private LocalDateTime hireDate;//员工入职时间
    private LocalDateTime updatatime;//修改时间
    private String stata;//员工状态

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public LocalDateTime getHireDate() {
        return hireDate;
    }

    public void setHireDate(LocalDateTime hireDate) {
        this.hireDate = hireDate;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public double getSalary() {
        return salary;
    }

    public String getStata() {
        return stata;
    }

    public void setStata(String stata) {
        this.stata = stata;
    }

    public LocalDateTime getUpdatatime() {
        return updatatime;
    }

    public void setUpdatatime(LocalDateTime updatatime) {
        this.updatatime = updatatime;
    }

    public Employee(int id, String name, int age, String phone, String idCard,
                    String address, String gender, String job, double salary,
                    String stata,LocalDateTime hireDate,LocalDateTime updatatime) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.phone = phone;
        this.idCard = idCard;
        this.address = address;
        this.gender = gender;
        this.job = job;
        this.salary = salary;
        this.stata = stata;
        this.hireDate = hireDate;
        this.updatatime = updatatime;
    }
    public Employee(int id, String name, String phone, String gender, String job,String stata,LocalDateTime updatatime) {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.gender = gender;
        this.job = job;
        this.stata = stata;
        this.updatatime = updatatime;
    }

    public Employee() {

    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
    public String toString() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String formattedHireDate = hireDate.format(formatter);
        return "| ID:" + id +
                " | 姓名:'" + name + '\'' +
                " | 年龄:" + age +
                " | 电话:'" + phone + '\'' +
                " | 身份证:'" + idCard + '\'' +
                " | 地址:'" + address + '\'' +
                " | 性别:'" + gender + '\'' +
                " | 职位:'" + job + '\'' +
                " | 薪资:" + salary+'\'' +
                " | 入职时间:" + formattedHireDate+" |";
    }

    public String toString2() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String formattedHireDate = updatatime.format(formatter);
        return "| ID:" + id +
                " | 姓名:'" + name + '\'' +
                " | 电话:'" + phone + '\'' +
                " | 性别:'" + gender + '\'' +
                " | 职位:'" + job + '\'' +
                " | 状态:'" + stata + '\'' +
                " | 更新时间:" + formattedHireDate+" |";
    }
}